<div class="page-middle testimonies">
    <div class="n_testimony" id="n_testimony">
        <div class="n_title_more">
            <span>TESTIMONIAL</span>
            <label class="read_more label_add_testimony" onClick="javascript:addTestimony()">Add Testimony</label>
        </div>
        <div class="add_testimony">
            <?php 
                echo $this->Form->Create('Page', array('onSubmit' => 'return validate()'));
                echo $this->Form->input('testimony', array('class' => 'txt_testimony','type' => 'textarea', 'label' => false));
                echo $this->Form->end('Submit');
            ?>
        </div>
        <ul>
        <?php
            foreach($testimonies as $testimony){
                echo '
                    <li>
                        <dl>
                            <dt></dt>
                            <dd>
                                <div class="squot_left">
                                    <span class="squot_left comment">
                                        ' . $testimony['Article']['content'] . '
                                    </span>
                                </div>
                                <span class="comment_name">- ' . $testimony['User']['username'] . '</span>
                            </dd>
                        </dl>
                    </li>
                ';
            }
         ?>
         </ul>
         <div class="paging" style="padding:0 10px;">
            <?php
            echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
            echo $this->Paginator->numbers(array('separator' => ''));
            echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
            ?>
        </div>
    </div>
</div>
<script>    
    function addTestimony(){
        $('.add_testimony').slideToggle('slow');
    }
    function validate(){
        if($('#PageTestimony').val() == ""){
            alert('Please enter any comments');
            $('#PageTestimony').focus();
            return false;
        }
    }
</script>